require(['config'], () => {
  require(['jquery', 'header', 'footer','pAjax', 'banner', 'product'], () => {
    class Index {
      constructor() {
        this.shoUserName()
        this.quit()
      }

      /* 渲染 */
      shoUserName() {
        let userList = JSON.parse(localStorage.getItem('user-Message'))
        let userMessage = `
                      <a href="#"><img src="/img/logo.png" alt=""></a><br>
                      <p><span class="userName">${userList.username}</span>,你好<span class="iconfont icon-tuichu"></span></p>
                      `
        const user = document.querySelector('.user>.header')
        user.innerHTML = userMessage
      }
     

/**
 * 清除用户名
 */
      quit() {
        $('.icon-tuichu').on('click', function () {

          let userMessage = `
  <a href="#"><img src="/img/logo.png" alt=""></a><br>
  <p><span class="userName">hi</span>,你好</p>
  `
          const user = document.querySelector('.user>.header')
          user.innerHTML = userMessage
          localStorage.removeItem('user-Message')
        })


      }

    }
    new Index()




  })
})